/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.unal.bioingenium.kbmed.knowledge.hierarchy.vo;

import edu.uci.ics.jung.graph.Graph;
import java.io.Serializable;
import java.util.Map;
import java.util.Set;

/**
 *
 * @author Alejandro Riveros Cruz
 */
public class Hierarchy implements Serializable {

    private static final long serialVersionUID = 4633585037282028290L;
    private String categoryName;
    private Graph<Vertex, Edge> directedHierarchyGraph;
    private Graph<Vertex, Edge> undirectedHierarchyGraph;
    private String topConceptId;
    private int totalConcepts;
    private int hierachyDepth;
    private Map<Vertex, Number> depthMap;
    private Map<String, Vertex> vertexMap;
    private Set<String> leavesSet;

    /**
     *
     * @param categoryName
     */
    public Hierarchy(String categoryName) {
        this.categoryName = categoryName;
    }

    /**
     *
     * @return
     */
    public String getCategoryName() {
        return categoryName;
    }

    /**
     *
     * @param categoryName
     */
    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    /**
     *
     * @return
     */
    public int getHierachyDepth() {
        return hierachyDepth;
    }

    /**
     *
     * @param hierachyDepth
     */
    public void setHierachyDepth(int hierachyDepth) {
        this.hierachyDepth = hierachyDepth;
    }

    /**
     *
     * @return
     */
    public Graph<Vertex, Edge> getDirectedHierarchyGraph() {
        return directedHierarchyGraph;
    }

    /**
     *
     * @param hierarchyGraph
     */
    public void setDirectedHierarchyGraph(Graph<Vertex, Edge> hierarchyGraph) {
        this.directedHierarchyGraph = hierarchyGraph;
    }

    /**
     *
     * @return
     */
    public Graph<Vertex, Edge> getUndirectedHierarchyGraph() {
        return undirectedHierarchyGraph;
    }

    /**
     *
     * @param undirectedHierarchyGraph
     */
    public void setUndirectedHierarchyGraph(Graph<Vertex, Edge> undirectedHierarchyGraph) {
        this.undirectedHierarchyGraph = undirectedHierarchyGraph;
    }

    /**
     *
     * @return
     */
    public int getTotalConcepts() {
        return totalConcepts;
    }

    /**
     *
     * @param totalConcepts
     */
    public void setTotalConcepts(int totalConcepts) {
        this.totalConcepts = totalConcepts;
    }

    /**
     * 
     * @return
     */
    public Map<Vertex, Number> getDepthMap() {
        return depthMap;
    }

    /**
     *
     * @param depthMap
     */
    public void setDepthMap(Map<Vertex, Number> depthMap) {
        this.depthMap = depthMap;
    }

    /**
     * 
     * @return
     */
    public String getTopConceptId() {
        return topConceptId;
    }

    /**
     * 
     * @param topConceptId
     */
    public void setTopConceptId(String topConceptId) {
        this.topConceptId = topConceptId;
    }

    /**
     * 
     * @return
     */
    public Map<String, Vertex> getVertexMap() {
        return vertexMap;
    }

    /**
     * 
     * @return
     */
    public Set<String> getLeavesSet() {
        return leavesSet;
    }

    /**
     * 
     * @param leavesSet
     */
    public void setLeavesSet(Set<String> leavesSet) {
        this.leavesSet = leavesSet;
    }

    /**
     * 
     * @param vertexMap
     */
    public void setVertexMap(Map<String, Vertex> vertexMap) {
        this.vertexMap = vertexMap;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Hierarchy other = (Hierarchy) obj;
        if ((this.categoryName == null) ? (other.categoryName != null) : !this.categoryName.equals(other.categoryName)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 79 * hash + (this.categoryName != null ? this.categoryName.hashCode() : 0);
        return hash;
    }
}
